// ml:run = $bin < input
#include <iostream>

using ll = long long;

ll n;

int main()
{
    std::ios_base::sync_with_stdio(false);
    int T; std::cin >> T;
    for (int ti = 1; ti <= T; ti++) {
        std::cout << "Case #" << ti << ": ";
        std::cin >> n;
        if (n == 1) {
            std::cout << "0\n";
            continue;
        }
        ll ans = (1 + n) * n / 2;
        std::cout << --ans << "\n";
    }
}

